import { validChildForms } from '@/utils/util.js';
export default {
  data() {
    return {
      validateForms: [],
    };
  },
  provide() {
    return {
      addChild: formVm => {
        this.validateForms.push(formVm);
      },
    };
  },
  methods: {
    async validChildForms() {
      const errors = await validChildForms(this.validateForms);
      if (errors.length) {
        return false;
      }
      return true;
    },
  },
};
